﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Dynamic;

namespace DynamicFunInStaticLanguages
{
    public class SayCode : DynamicObject
    {
        public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, out object result)
        {
            Console.WriteLine(binder.Name.Replace("Say", String.Empty));

            result = binder.Name;
            return true;
        }

        public void HailYourCreator()
        {
            Console.WriteLine(String.Empty);
            Console.WriteLine("--------------------------------------");
            Console.WriteLine("Eric is teh r0x0r!!!!");
            Console.WriteLine("--------------------------------------");
            Console.WriteLine(String.Empty);
        }
    }
}
